.class public Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;
.super Lorg/apache/cordova/CordovaPlugin;

# interfaces
.implements Ljava/util/Observer;


# instance fields
.field public final a:Ljava/lang/String;

.field private b:Lorg/apache/cordova/WqCordovaActivity;

.field private c:Lorg/apache/cordova/CallbackContext;

.field private d:Ljava/lang/String;

.field private e:Ljava/lang/String;

.field private f:Ljava/lang/String;

.field private g:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Lorg/apache/cordova/CordovaPlugin;-><init>()V

    invoke-static {}, Ljava/util/UUID;->randomUUID()Ljava/util/UUID;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/UUID;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->a:Ljava/lang/String;

    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->d:Ljava/lang/String;

    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->e:Ljava/lang/String;

    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->f:Ljava/lang/String;

    const-string/jumbo v0, "0"

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->g:Ljava/lang/String;

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->e:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic b(Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;)Lorg/apache/cordova/WqCordovaActivity;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->b:Lorg/apache/cordova/WqCordovaActivity;

    return-object v0
.end method

.method static synthetic c(Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->f:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic d(Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->d:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic e(Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->g:Ljava/lang/String;

    return-object v0
.end method


# virtual methods
.method public execute(Ljava/lang/String;Lorg/apache/cordova/CordovaArgs;Lorg/apache/cordova/CallbackContext;)Z
    .locals 2

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->cordova:Lorg/apache/cordova/CordovaInterface;

    invoke-interface {v0}, Lorg/apache/cordova/CordovaInterface;->getActivity()Landroid/app/Activity;

    move-result-object v0

    check-cast v0, Lorg/apache/cordova/WqCordovaActivity;

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->b:Lorg/apache/cordova/WqCordovaActivity;

    iput-object p3, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->c:Lorg/apache/cordova/CallbackContext;

    invoke-static {}, Lcom/waiqin365/lightapp/view/a/b;->a()Ljava/util/Observable;

    move-result-object v0

    invoke-virtual {v0, p0}, Ljava/util/Observable;->addObserver(Ljava/util/Observer;)V

    if-eqz p2, :cond_0

    invoke-virtual {p2, v1}, Lorg/apache/cordova/CordovaArgs;->isNull(I)Z

    move-result v0

    if-nez v0, :cond_0

    invoke-virtual {p2, v1}, Lorg/apache/cordova/CordovaArgs;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_0

    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1, v0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    const-string/jumbo v0, "allCanSelectIds"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    const-string/jumbo v0, "allCanSelectIds"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->e:Ljava/lang/String;

    :goto_0
    const-string/jumbo v0, "selectedIds"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_2

    const-string/jumbo v0, "selectedIds"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->d:Ljava/lang/String;

    :goto_1
    const-string/jumbo v0, "unEnableIds"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    const-string/jumbo v0, "unEnableIds"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->f:Ljava/lang/String;

    :goto_2
    const-string/jumbo v0, "departmentWithoutMan"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_4

    const-string/jumbo v0, "departmentWithoutMan"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->g:Ljava/lang/String;

    :cond_0
    :goto_3
    iget-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->b:Lorg/apache/cordova/WqCordovaActivity;

    invoke-virtual {v0}, Lorg/apache/cordova/WqCordovaActivity;->getThreadPool()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    new-instance v1, Lcom/waiqin365/h5/contacts/b;

    invoke-direct {v1, p0}, Lcom/waiqin365/h5/contacts/b;-><init>(Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;)V

    invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    const/4 v0, 0x1

    return v0

    :cond_1
    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->e:Ljava/lang/String;

    goto :goto_0

    :cond_2
    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->d:Ljava/lang/String;

    goto :goto_1

    :cond_3
    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->f:Ljava/lang/String;

    goto :goto_2

    :cond_4
    const-string/jumbo v0, "0"

    iput-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->g:Ljava/lang/String;

    goto :goto_3
.end method

.method public update(Ljava/util/Observable;Ljava/lang/Object;)V
    .locals 6

    if-eqz p2, :cond_5

    instance-of v0, p2, Lcom/waiqin365/lightapp/view/a/a;

    if-eqz v0, :cond_5

    iget-object v1, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->a:Ljava/lang/String;

    move-object v0, p2

    check-cast v0, Lcom/waiqin365/lightapp/view/a/a;

    iget-object v0, v0, Lcom/waiqin365/lightapp/view/a/a;->a:Ljava/lang/String;

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_5

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    move-object v0, p2

    check-cast v0, Lcom/waiqin365/lightapp/view/a/a;

    iget-object v0, v0, Lcom/waiqin365/lightapp/view/a/a;->b:Ljava/lang/Object;

    instance-of v0, v0, Ljava/util/ArrayList;

    if-eqz v0, :cond_5

    check-cast p2, Lcom/waiqin365/lightapp/view/a/a;

    iget-object v0, p2, Lcom/waiqin365/lightapp/view/a/a;->b:Ljava/lang/Object;

    check-cast v0, Ljava/util/ArrayList;

    invoke-static {}, Lcom/waiqin365/lightapp/view/a/b;->a()Ljava/util/Observable;

    move-result-object v1

    invoke-virtual {v1, p0}, Ljava/util/Observable;->deleteObserver(Ljava/util/Observer;)V

    if-eqz v0, :cond_5

    new-instance v2, Lorg/json/JSONArray;

    invoke-direct {v2}, Lorg/json/JSONArray;-><init>()V

    const-string/jumbo v1, "time"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    new-instance v4, Ljava/util/Date;

    invoke-direct {v4}, Ljava/util/Date;-><init>()V

    invoke-virtual {v4}, Ljava/util/Date;->getTime()J

    move-result-wide v4

    invoke-virtual {v3, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string/jumbo v4, ""

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v1, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :cond_0
    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_4

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/lightapp/kehu/share/a/c;

    if-eqz v0, :cond_0

    new-instance v4, Lorg/json/JSONObject;

    invoke-direct {v4}, Lorg/json/JSONObject;-><init>()V

    :try_start_0
    const-string/jumbo v5, "id"

    iget-object v1, v0, Lcom/waiqin365/lightapp/kehu/share/a/c;->a:Ljava/lang/String;

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_1

    const-string/jumbo v1, ""

    :goto_1
    invoke-virtual {v4, v5, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v5, "name"

    iget-object v1, v0, Lcom/waiqin365/lightapp/kehu/share/a/c;->b:Ljava/lang/String;

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_2

    const-string/jumbo v1, ""

    :goto_2
    invoke-virtual {v4, v5, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v1, "isEMP"

    iget-object v5, v0, Lcom/waiqin365/lightapp/kehu/share/a/c;->u:Ljava/lang/String;

    invoke-static {v5}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v5

    if-nez v5, :cond_3

    const-string/jumbo v5, "1"

    iget-object v0, v0, Lcom/waiqin365/lightapp/kehu/share/a/c;->u:Ljava/lang/String;

    invoke-virtual {v5, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    const-string/jumbo v0, "1"

    :goto_3
    invoke-virtual {v4, v1, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_4
    invoke-virtual {v2, v4}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    goto :goto_0

    :cond_1
    :try_start_1
    iget-object v1, v0, Lcom/waiqin365/lightapp/kehu/share/a/c;->a:Ljava/lang/String;

    goto :goto_1

    :cond_2
    iget-object v1, v0, Lcom/waiqin365/lightapp/kehu/share/a/c;->b:Ljava/lang/String;

    goto :goto_2

    :cond_3
    const-string/jumbo v0, "0"
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_3

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_4

    :cond_4
    const-string/jumbo v0, "time"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    new-instance v3, Ljava/util/Date;

    invoke-direct {v3}, Ljava/util/Date;-><init>()V

    invoke-virtual {v3}, Ljava/util/Date;->getTime()J

    move-result-wide v4

    invoke-virtual {v1, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v3, ""

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v0, p0, Lcom/waiqin365/h5/contacts/WqEmployeeSelectMore;->c:Lorg/apache/cordova/CallbackContext;

    invoke-virtual {v0, v2}, Lorg/apache/cordova/CallbackContext;->success(Lorg/json/JSONArray;)V

    :cond_5
    return-void
.end method
